//
// CSurfaceLightGrid.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;
import org.ryzom.nel.misc.CVector;
import org.ryzom.nel.misc.IStream;

public class CSurfaceLightGrid {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CSurfaceLightGrid(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CSurfaceLightGrid obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CSurfaceLightGrid(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setOrigin(SWIGTYPE_p_NLMISC__CVector2f value) {
    nel3dJNI.CSurfaceLightGrid_Origin_set(swigCPtr, this, SWIGTYPE_p_NLMISC__CVector2f.getCPtr(value));
  }

  public SWIGTYPE_p_NLMISC__CVector2f getOrigin() {
    long cPtr = nel3dJNI.CSurfaceLightGrid_Origin_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NLMISC__CVector2f(cPtr, false);
  }

  public void setWidth(long value) {
    nel3dJNI.CSurfaceLightGrid_Width_set(swigCPtr, this, value);
  }

  public long getWidth() {
    return nel3dJNI.CSurfaceLightGrid_Width_get(swigCPtr, this);
  }

  public void setHeight(long value) {
    nel3dJNI.CSurfaceLightGrid_Height_set(swigCPtr, this, value);
  }

  public long getHeight() {
    return nel3dJNI.CSurfaceLightGrid_Height_get(swigCPtr, this);
  }

  public void setCells(SWIGTYPE_p_NLMISC__CObjectVectorT_NL3D__CSurfaceLightGrid__CCellCorner_t value) {
    nel3dJNI.CSurfaceLightGrid_Cells_set(swigCPtr, this, SWIGTYPE_p_NLMISC__CObjectVectorT_NL3D__CSurfaceLightGrid__CCellCorner_t.getCPtr(value));
  }

  public SWIGTYPE_p_NLMISC__CObjectVectorT_NL3D__CSurfaceLightGrid__CCellCorner_t getCells() {
    long cPtr = nel3dJNI.CSurfaceLightGrid_Cells_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NLMISC__CObjectVectorT_NL3D__CSurfaceLightGrid__CCellCorner_t(cPtr, false);
  }

  public CSurfaceLightGrid() {
    this(nel3dJNI.new_CSurfaceLightGrid(), true);
  }

  public void getStaticLightSetup(CRGBA sunAmbient, CVector localPos, SWIGTYPE_p_std__vectorT_NL3D__CPointLightInfluence_t pointLightList, SWIGTYPE_p_unsigned_char sunContribution, CIGSurfaceLight igsl, CRGBA localAmbient) {
    nel3dJNI.CSurfaceLightGrid_getStaticLightSetup(swigCPtr, this, CRGBA.getCPtr(sunAmbient), sunAmbient, CVector.getCPtr(localPos), localPos, SWIGTYPE_p_std__vectorT_NL3D__CPointLightInfluence_t.getCPtr(pointLightList), SWIGTYPE_p_unsigned_char.getCPtr(sunContribution), CIGSurfaceLight.getCPtr(igsl), igsl, CRGBA.getCPtr(localAmbient), localAmbient);
  }

  public void serial(IStream f) {
    nel3dJNI.CSurfaceLightGrid_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public final static int NumLightPerCorner = nel3dJNI.CSurfaceLightGrid_NumLightPerCorner_get();

}
